C (158/301)

From:Ben Hutchings
Date:25 Aug 99 at 23:27:35
Subject:Re: ExecBase & 'RESET:starting PC' exception

From: Ben Hutchings <womble@zzumbouk.demon.co.uk>

On Wed, Aug 25, 1999 at 10:38:58PM +0100, Gabriele Svelto wrote:
> From: Gabriele Svelto <jlpicard@tiscalinet.it>
>
> Hello everybody,
> this question is a little bit on the asm side so I hope I'm not making an
> off topic...
> I read in the RKRM that ExecBase is the only part of the OS which is at an
> absolute address in memory ($00000004). Well since I took a look at some
> asm tutorials (as I'm interested in putting in asm some routines which are
> reaaally time crictical...) and found that the location $4 contained the
> pointer to the 'RESET: starting PC' exception.

That's not actually an exception.

> Now after taking a moment to think 'bout I came to the conclusion
> that the routine pointed by ExecBase is the routine which is
> executed immediately after a reset...

No; ExecBase does not contain code. For a short time after a reset,
the Kickstart ROM is mapped to the bottom of memory, so the initial PC
is read from there.

<snip>
> BTW, what are exceptions in C++? I'm learning C++ now but I haven't found
> anything about that in the book I'm reading (maybe it's because it is a
> little bit outdated, 1990...).

Exceptions are an alternative way of returning from a function in an
unusual (generally error) case. Exception objects `thrown' in one
function can be caught by the exception handler of the enclosing scope
or a calling function, which may be much farther up the call stack.
During exception-processing, destructors will be called just as for a
normal function return. An uncaught exception aborts the program.

Careful use of exceptions allows you to avoid the complexity of
conventional error-checking and processing techniques, *but* in order
to use exceptions safely you must consider what will happen to an
object if one of its member functions terminates due to an exception.



Ben Hutchings - womble@zzumbouk.demon.co.uk, http://www.zzumbouk.demon.co.uk
Team *AMIGA* | Jay Miner Society | Linux - the choice of a GNU generation
Any smoothly functioning technology is indistinguishable from a rigged demo.